package org.iblink.core.domain.dao;

import java.util.List;

import org.iblink.core.domain.model.Asset;

/**
 * Interface for accessing assets from database.
 * 
 * @author tpares
 *
 */
public interface AssetDao {
  /**
   * Retrieve an asset from database.
   * @param assetId the ID of the asset to load
   * @return the {@code Asset} object with ID {@code assetId}.
   */
  Asset getAsset(long assetId);
  
  /**
   * Lists all assets assigned to category with ID {@code categoryId}
   * @param categoryId the ID of the category for which we want the assets
   * @return the lists of assets assigned to the given category
   */
  List<Asset> getAssetsForCategory(long categoryId);
  
  /**
   * <p>Saves or updates an asset</p>
   * @param asset the asset to save or update
   */
  void saveAsset(Asset asset);
  
  /**
   * Deletes an asset.
   * @param assetId the ID of the asset to delete
   */
  void deleteAsset(long assetId);
  
  /**
   * Find the asset with the given path.
   * 
   * @param path the path of the asset to find
   * @return the {@link org.iblink.core.domain.model.Asset} with path {@code path}
   */
  Asset findByPath(String path);
}
